{% extends "content.html" %}

{% load i18n %}
{% load app_tags %}

{% block head %}
{{ block.super }}
    <link href="/static/stylesheets/home.css?{% server_start_time %}" media="screen, projection" rel="stylesheet" type="text/css" />
{% endblock %}

{% block content %}

{% if settings.CURRENT_PPO_MODE == settings.PPO_MODES.DOC_EDIT_MODE %}
{% include '_paddle_docs_modal.html' %}
{% endif %}

<div class="container home-doc-mode doc-content">
    <div class="row">
        <h1 class="col-lg-12">{% trans "PaddlePaddle Document Viewer" %}</h1>

        {% if not folder_names %}
        <h4 class="col-lg-12">{% blocktrans %}Welcome to PaddlePaddle.org document viewer.  To get started, please clone one or more documentation repos.{% endblocktrans %}</h4>
        <pre class="col-lg-12">mkdir paddlepaddle
cd paddlepaddle
git clone git@github.com:PaddlePaddle/Paddle.git
git clone git@github.com:PaddlePaddle/book.git
git clone git@github.com:PaddlePaddle/models.git
git clone https://github.com/PaddlePaddle/Mobile.git</pre>
        <h4 class="col-lg-12">{% trans "Start PaddlePaddle.org document viewer" %}</h4>
        <pre class="col-lg-12">docker run -d -p 8000:8000 -v `pwd`:/var/content paddlepaddle/paddlepaddle.org:latest</pre>
        <h4 class="col-lg-12">{% trans "Refresh This page" %}</h4>
        <a class="col-lg-3 btn btn-light" href="{% url 'home' %}">{% trans "Refresh" %}</a>

        {% else %}
        <h4 class="col-lg-12">{% trans "Select content repo to generate documentation:" %}</h4>

        {% for folder_name in folder_names %}
        <div class="btn-container col-lg-3">
            {% if folder_name == 'Paddle' %}
            <a href="#" class="btn btn-light" data-toggle="modal" data-target="#paddleDocsModal">{{ folder_name }}</a>
            {% else %}
            <a class="btn btn-light" href="{% url 'reload_docs' %}?folder_name={{ folder_name }}" onclick="return showFullpageSpinnerForContentId('{{ folder_name }}');">{{ folder_name }}</a>
            {% endif %}
        </div>
        {% endfor %}

        {% endif %}
    </div>
</div>

{% endblock %}